﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

using ServiceLayer.Entity;
using DataAccessLayer;


namespace ServiceLayer
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService" in both code and config file together.

    [ServiceContract]
    public interface IService
    {
        #region login authentication
        //login authentication
        [OperationContract]
        [WebInvoke(UriTemplate = "/Login", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool Login(UserW user);
        #endregion

        #region welcome
        //welcome get employee name by username
        [OperationContract]
        [WebGet(UriTemplate = "/EmpName/{userName}", ResponseFormat = WebMessageFormat.Json)]
        String GetEmpName(string userName);

        //welcome get department name by username
        [OperationContract]
        [WebGet(UriTemplate = "/Department/{userName}", ResponseFormat = WebMessageFormat.Json)]
        String GetDept(string userName);

        //welcome get role from username
        [OperationContract]
        [WebGet(UriTemplate = "/Role/{userName}", ResponseFormat = WebMessageFormat.Json)]
        RoleW GetRole(string userName);
        #endregion

        #region make requisition
        //make requisition get all category
        [OperationContract]
        [WebGet(UriTemplate = "/Category", ResponseFormat = WebMessageFormat.Json)]
        CategoryW[] CategoryN();

        //make requisition get all item based on choosed categoryName
        [OperationContract]
        [WebGet(UriTemplate = "/CateNameList/{categoryName}", ResponseFormat = WebMessageFormat.Json)]
        StationeryW[] ItemN(string categoryName);

        //make requisition Submit
        [OperationContract]
        [WebInvoke(UriTemplate = "/ReqSubmit/{userName}", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool ReqSubmit(string userName, Req[] reqList);
        #endregion

        #region approve requisition
        //approve requisition  get requisition employee name list
        [OperationContract]
        [WebGet(UriTemplate = "/GetReqNameList/{userName}", ResponseFormat = WebMessageFormat.Json)]
        EmployeeW[] getRNList(string userName);

        //approve requisition get approval list
        [OperationContract]
        [WebGet(UriTemplate = "/GetApproveList/{empName}", ResponseFormat = WebMessageFormat.Json)]
        App[] getAList(string empName);

        //approve requisition get all approval list
        [OperationContract]
        [WebGet(UriTemplate = "/GetAllApproveList/{userName}", ResponseFormat = WebMessageFormat.Json)]
        App[] getAllAList(string userName);

        //approve requisition get requisition approval list details
        [OperationContract]
        [WebGet(UriTemplate = "/GetReqDetailList/{reqID}", ResponseFormat = WebMessageFormat.Json)]
        AppDetail[] getRDList(string reqID);

        //approve requisition submit approval result
        [OperationContract]
        [WebInvoke(UriTemplate = "/AppSubmit/{reqName}/{reqID}", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool AppSubmit(string reqName, string reqID, AppDetail[] appList);
        #endregion

        #region store retrieval
        //store retrieval get retrieval list and allocate it first
        [OperationContract]
        [WebGet(UriTemplate = "/GetRetrievalAndAllocate", ResponseFormat = WebMessageFormat.Json)]
        Ret[] getRetAndAlc();

        //store retrieval confirm collection
        [OperationContract]
        [WebGet(UriTemplate = "/ConfirmCollection/{userName}", ResponseFormat = WebMessageFormat.Json)]
        bool confirmCon(string userName);

        //store retrieval get retrieval allocation details based on item
        [OperationContract]
        [WebGet(UriTemplate = "/GetRetrievalDetail/{itemCode}", ResponseFormat = WebMessageFormat.Json)]
        RetDetail[] getRetDetail(string itemCode);

        //stroe retrieval allocate actuall quantity for each department
        [OperationContract]
        [WebInvoke(UriTemplate = "/AllocateQty/{itemCode}", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool allocateQty(string itemCode, RetDetail[] retList);
        #endregion

        #region store disbursment list
        //store disbursment list get all collection point name list
        [OperationContract]
        [WebGet(UriTemplate = "/GetColPointNameList", ResponseFormat = WebMessageFormat.Json)]
        CollectionPointW[] getColPointNameList();

        //store disbursment list get department list for disbursement confirmation
        [OperationContract]
        [WebGet(UriTemplate = "/GetDeptListForDisburse/{colPoint}", ResponseFormat = WebMessageFormat.Json)]
        Disburse[] getDeptListForDisburse(string colPoint);

        //store disbursment list get item list for disbursment of selected department
        [OperationContract]
        [WebGet(UriTemplate = "/GetDisburseItemList/{deptName}", ResponseFormat = WebMessageFormat.Json)]
        DisDetail[] getDisburseItemList(string deptName);

        //store disbursment list update lost/damaged qty and confirm disbursement list by clerk
        [OperationContract]
        [WebInvoke(UriTemplate = "/ConfirmByClerk/{userName}/{deptName}", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool confirmByClerk(string userName, string deptName, DisDetail[] list);
        #endregion

        #region Department disbursment list
        //Department disbursment list get department list for viewing disbursement history
        [OperationContract]
        [WebGet(UriTemplate = "/GetDisburseHistory/{userName}", ResponseFormat = WebMessageFormat.Json)]
        Disburse[] getDisburseHistory(string userName);

        //Department disbursment list get item list for each disbursment of selected department
        [OperationContract]
        [WebGet(UriTemplate = "/GetDisburseHistoryItemList/{userName}/{colDetId}/{day}/{month}/{year}", ResponseFormat = WebMessageFormat.Json)]
        DisDetail[] getDisburseHistoryItemList(string userName, string colDetId, string day, string month, string year);

        //Department disbursment list confirm disbursement list by dept representative
        [OperationContract]
        [WebGet(UriTemplate = "/ConfirmByRep/{userName}/{colDetId}/{day}/{month}/{year}", ResponseFormat = WebMessageFormat.Json)]
        bool confirmByRepresentative(string userName, string colDetId, string day, string month, string year);
        #endregion

        #region issue ajustment voucher

        //issue ajustment voucher display all category name
        [OperationContract]
        [WebGet(UriTemplate = "/GetCateNameList", ResponseFormat = WebMessageFormat.Json)]
        CategoryW[] getCateNameList();

        //issue ajustment voucher display all item name by chosed category
        [OperationContract]
        [WebGet(UriTemplate = "/GetItemNameList/{cateName}", ResponseFormat = WebMessageFormat.Json)]
        StationeryW[] getItemNameList(string cateName);

        //issue ajustment voucher display all supplier name by chosed item
        [OperationContract]
        [WebInvoke(UriTemplate = "/GetSupNameList", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        SupplierW[] getSupNameList(DisDetail item);

        //issue ajustment voucher submit adjustment voucher
        [OperationContract]
        [WebInvoke(UriTemplate = "/AdjustSubmit/{userName}", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool adjSubmit(string userName, StockAdj[] adjList);

        //issue ajustment voucher get available quantity based on item name
        [OperationContract]
        [WebInvoke(UriTemplate = "/GetCurrentQty", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        DisDetail getCurrentQty(DisDetail item);

        #endregion

        #region Test
        //Test
        [OperationContract]
        [WebGet(UriTemplate = "/Test", ResponseFormat = WebMessageFormat.Json)]
        UserW[] List();
        //Test
        [OperationContract]
        [WebGet(UriTemplate = "/Call", ResponseFormat = WebMessageFormat.Json)]
        String Call();
        //Test
        [OperationContract]
        [WebInvoke(UriTemplate = "/LC", Method = "POST",
            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        bool LC(UserW[] list);
        //Test
        [OperationContract]
        [WebGet(UriTemplate = "/Txt/{a}/{b}", ResponseFormat = WebMessageFormat.Json)]
        bool dou(string a, string b);
        #endregion
    }

}